#include <iostream.h>

class Picture{

friend ostream& operator<<(ostream&, const Picture&);
friend Picture frame(const Picture&);
friend Picture operator& (const Picture&, const Picture&);
friend Picture operator| (const Picture&, const Picture&);

public:
	Picture();
	Picture(const char* const*, int);
	Picture(const Picture&);
	~Picture();

	Picture& operator=(const Picture&);

private:
	int height, width;
	char* data;

	void copyblock(int, int, const Picture&);
	inline char& position(int row, int col){return data[row * width + col];}
	inline char position(int row, int col) const {return data[row * width + col];}
	void init(int, int);
	void clear(int, int, int, int);
	static int max(int, int);
};

